<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            width: 200px;
            height: 200px;
            background-color: #6ff;
            border: 1px solid transparent;
            margin: 50px;
        }

        #box.active {
            background-color: red;
        }
    </style>
</head>

<body>
    <div id="box" class="one two three"></div>
</body>
<script>

    var box = document.getElementById("box");

    // 鼠标移入事件 -> 鼠标移入指定元素是触发事件
    box.onmouseover = function () {
        console.log("移入...");
        this.classList.add("active");
    }

    box.onmouseout = function () {
        console.log("移除...");
        this.classList.remove("active");
    }






</script>

</html>